<?php
/* @var $this ProductController */
/* @var $model Product */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'product-form',
	'enableAjaxValidation'=>true,
	'enableClientValidation'=>true,
	'htmlOptions' => array('enctype'=>'multipart/form-data')
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'model'); ?>
		<?php echo $form->textField($model,'model',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'model'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row">
                <?php $listData = CHtml::listData(Category::model()->findAll(), 'id', 'name') ?>
		<?php echo $form->labelEx($model,'category'); ?>
		<?php echo $form->dropDownList($model, 'category', $listData)?>
		<?php echo $form->error($model,'category'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'file'); ?>
		<?php echo $form->fileField($model,'file',array('size'=>60,'maxlength'=>255));?>
		<?php echo $form->error($model,'file'); ?>
                <p class="hint">
                    Recommended image sizes: 500 pixel x 400 pixel. jpg, png, gif are allowed. 
		</p>
	</div>


	<div class="row">
		<?php echo $form->labelEx($model,'highlight'); ?>
		<?php $this->widget('application.extensions.ckeditor.CKEditor', array(
                'model'=>$model,
                'attribute'=>'highlight',
                'language'=>'en',
                'editorTemplate'=>'full',
                )); ?>
		<?php echo $form->error($model,'highlight'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'overview'); ?>
		<?php $this->widget('application.extensions.ckeditor.CKEditor', array(
                'model'=>$model,
                'attribute'=>'overview',
                'language'=>'en',
                'editorTemplate'=>'full',
                )); ?>
		<?php echo $form->error($model,'overview'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'features'); ?>
		<?php $this->widget('application.extensions.ckeditor.CKEditor', array(
                'model'=>$model,
                'attribute'=>'features',
                'language'=>'en',
                'editorTemplate'=>'full',
                )); ?>
		<?php echo $form->error($model,'features'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'specifications'); ?>
		<?php $this->widget('application.extensions.ckeditor.CKEditor', array(
                'model'=>$model,
                'attribute'=>'specifications',
                'language'=>'en',
                'editorTemplate'=>'full',
                )); ?>
		<?php echo $form->error($model,'specifications'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'downloads'); ?>
		<?php $this->widget('exts.ckeditor.CKEditor', array(
                'model'=>$model,
                'attribute'=>'downloads',
                'language'=>'en',
                'editorTemplate'=>'full',
                )); ?>
		<?php echo $form->error($model,'downloads'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->